import React, { Component } from 'react'
import RouterView from '../router/RouterView';
import RouterLink from '../router/RouterLink';



// ❤ 二级路由页面 
export class Home extends Component {
  render() {
    console.log("props", this.props);
    const { routerConfig } = this.props; //解构的是从RouterView里面传来的二级路由item.children
    return (
      <div className='home'>
        <header>路由</header>

        {/* 二级路由:将接收到的 routerConfig再次传递给路由渲染组件
        routerConfig是接收的一级的children
        */}
        <main>
          <RouterView routerConfig={routerConfig}></RouterView>
        </main>

        {/* 二级路由切换按钮  */}
        <footer>
          <RouterLink routerConfig={routerConfig}></RouterLink>
        </footer>
      </div>
    )
  }
}

export default Home